import 'package:cbec_app/generated/json/base/json_field.dart';
import 'package:cbec_app/generated/json/com_title06_entity.g.dart';
import 'dart:convert';

import 'content_data.dart';
export 'package:cbec_app/generated/json/com_title06_entity.g.dart';

@JsonSerializable()
class ComTitle06Entity extends ContentData {
  @JSONField(name: "sub_text")
  String? subText = '';
  @JSONField(name: "more_text")
  String? moreText = '';
  @JSONField(name: "page_margin_top")
  int? pageMarginTop = 0;
  @JSONField(name: "title_size")
  String? titleSize = '';
  @JSONField(name: "desc_weight")
  String? descWeight = '';
  ComTitle06Link? link;
  @JSONField(name: "text_align_type")
  String? textAlignType = '';
  @JSONField(name: "bg_image")
  ComTitle06BgImage? bgImage;
  String? uuid = '';
  @JSONField(name: "mod_bgcolor")
  String? modBgcolor = '';
  @JSONField(name: "more_image")
  ComTitle06MoreImage? moreImage;
  @JSONField(name: "desc_color")
  String? descColor = '';
  @JSONField(name: "show_top_radius")
  bool? showTopRadius = false;
  @JSONField(name: "show_bottom_radius")
  bool? showBottomRadius = false;
  @JSONField(name: "show_more")
  bool? showMore = false;
  @JSONField(name: "page_margin_bottom")
  int? pageMarginBottom = 0;
  @JSONField(name: "page_margin")
  int? pageMargin = 0;
  @JSONField(name: "title_color")
  String? titleColor = '';
  @JSONField(name: "border_radius_type")
  String? borderRadiusType = '';
  @JSONField(name: "desc_size")
  String? descSize = '';
  @JSONField(name: "bg_color")
  String? bgColor = '';
  @JSONField(name: "more_type")
  String? moreType = '';
  @JSONField(name: "title_weight")
  String? titleWeight = '';
  @JSONField(name: "radius_num")
  int? radiusNum = 0;
  @JSONField(name: "page_margin_iner")
  int? pageMarginIner = 0;
  @JSONField(name: "main_text")
  String? mainText = '';

  ComTitle06Entity() {
    type = 'comtitle06'; // 直接在构造函数中赋值
  }

  factory ComTitle06Entity.fromJson(Map<String, dynamic> json) => $ComTitle06EntityFromJson(json);

  @override
  Map<String, dynamic> toJson() => $ComTitle06EntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  @override
  ContentData fromJson(Map<String, dynamic> json) {
    return ComTitle06Entity.fromJson(json);
  }
}

@JsonSerializable()
class ComTitle06Link {
  @JSONField(name: "link_type")
  String? linkType = '';
  @JSONField(name: "link_title")
  String? linkTitle = '';
  @JSONField(name: "link_id")
  int? linkId = 0;

  ComTitle06Link();

  factory ComTitle06Link.fromJson(Map<String, dynamic> json) => $ComTitle06LinkFromJson(json);

  Map<String, dynamic> toJson() => $ComTitle06LinkToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ComTitle06BgImage {
  @JSONField(name: "attachment_url")
  String? attachmentUrl = '';

  ComTitle06BgImage();

  factory ComTitle06BgImage.fromJson(Map<String, dynamic> json) => $ComTitle06BgImageFromJson(json);

  Map<String, dynamic> toJson() => $ComTitle06BgImageToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ComTitle06MoreImage {
  @JSONField(name: "attachment_url")
  String? attachmentUrl = '';

  ComTitle06MoreImage();

  factory ComTitle06MoreImage.fromJson(Map<String, dynamic> json) => $ComTitle06MoreImageFromJson(json);

  Map<String, dynamic> toJson() => $ComTitle06MoreImageToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
